home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 780 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: newsfeed.internetmci.com!xmission!news
  2. From: tknarr@xmission.com     ( Todd Knarr )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: two tricky questions
  5. Date: 7 Jan 1996 02:21:20 GMT
  6. Organization: Chaos Central
  7. Message-ID: <4cnan0$gqv@news.xmission.com>
  8. References: <4c6v9u$jdl@news.xmission.com> <DKLzyq.M1u@cix.compulink.co.uk>
  9. Reply-To: tknarr@xmission.com   ( Todd Knarr )
  10. NNTP-Posting-Host: slc112.xmission.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <DKLzyq.M1u@cix.compulink.co.uk>, henri@cix.compulink.co.uk ("Henry Andrew") writes:
  14. >sorry to be a pedant but C++ does not do a bitwise copy is a default copy 
  15. >ctor.  It does a memberwise copy.
  16.  
  17. Sorry to be a pedant back, but the grey book specifically mentions bitwise
  18. copies. Think about how the copy ctor for a class needs to work for two
  19. cases:
  20.  
  21. 1) the class contains members of a class without a copy ctor or copy
  22.    assignment.
  23. 2) the class contains an array.
  24.  
  25. The specific sequence is that the generated copy ctor uses memberwise copy
  26. for all members which have copy assignment or the copy ctor ( depending on
  27. circumstances ) defined, and bitwise copy for members that do not.
  28.  
  29. --
  30. Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  31.                                       |  Member, USENET Cabal
  32.  
  33. Seriously, I don't want to die just yet.  I don't care how
  34. good-looking they are, I! don't! want! to! die!"
  35.                                         -- Megazone ( UF1 )
  36.  
  37.